----------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  D:\BCDVS_95_4_2013\codes\BCDVS_95_4_2013_datageneration.log
  log type:  text
 opened on:  28 Mar 2014, 18:21:49

. use "BCDVS_source_data.dta", clear

. 
. 
. *****************************************************************************************************************
. ******  In this file we describe the data sources and how we constructed the main variables of interests   ******
. ******  For further details on the construction of the database please contact:                            ******
. ******  Dr. LORENZO CIARI (CiariL@ebrd.com)                                                                ******
. *****************************************************************************************************************
. 
. /****************************************************************************************************************
> 
> The starting point for the creation of the main variables used in 
> our regressions is the Stata datafile "BCDVS_source_data.dta"
> 
> This file was generated by merging different data sources. Most of the work
> to put these different sources together has been done in Excell. We therefore only
> report the cleaned raw data. The references to the papers cited in this file 
> can be found in the online Appendix of the paper.
> 
>                 **************************************************************************************
>                 **************************************************************************************
>                 ** Please notice that all databases used to construct our raw database have been    **
>                 ** downloaded during 2008. It might be that some of these databases (for instance   **
>                 ** the KLEMS database) have been since then updated. Hence, it might be that        ** 
>                 ** some of the values for some of the variables do not completely correspond to     **
>                 ** the values reported in our source database.                                      **
>                 **************************************************************************************
>                 **************************************************************************************
> 
> In the following, we report the various data sources and explain which 
> specific variables we used
> 
> 
> 1. The EU-KLEMS and the Groningen Growth and Development Centre databeses
> 
> TFP-related measures. All measures needed to generate TFP variables in 
>         our database are taken from the EU-KLEMS database. The exact construction
>         of some of this variables is explained below. The EU-KLEMS database covers 
>         all the countries involved in our study except for Canada. 
>         To measure TFP variables for Canada, we used data from the Groningen 
>         Growth and Development Centre (GGDC). The GGDC methodology is totally 
>         analogous to the one adopted by the EU-KLEMS consortium, of which the 
>         GGDC is a member. The correlation between the EU-KLEMS TFP and the GGDC 
>         TFP is high (0.7) and strongly significant. 
> 
> Human Capital. We measure human capital as the share of high-skilled 
>         labour employed in each country-industry in a given year. We took data 
>         on human capital from the KLEMS database, which holds information on 
>         the level of educational attainment of workers by industry for all 
>         the EU member countries, the US and Japan from 1970 to 2004. Unfortunately, 
>         data on human capital are not available for Canada.
> 
> 
> 2. OECD Analytical Business Enterprise Research and Development (ANBERD) database
> 
> R&D. The variable we use in our regressions is the ratio
>         between R&D expenditure and the industry-level value added, both in
>         nominal values. We gathered detailed data on the level of
>         expenditure in R&D in different industries from the OECD Analytical
>         Business Enterprise Research and Development (ANBERD) database,
>         which covers 19 OECD countries, from 1987 to 2004. We took data on
>         value added from the EU-KLEMS database. Unfortunately, data on R&D
>         for the 'Agriculture, forestry and fishing' sector and the 'Mining
>         and quarrying' sectors for all countries involved in the study, as
>         well as data for Hungary, are not available in ANBERD. We therfore 
>         integrated with OECD data for ISIC 1,2. The formula to construct this 
>         variable is: 
>         
>         gen rddklems= rd / valurealklemsppp
>         
>         where rd is R&D spending, source ANBERD, in constant prices constant gdp, 
>         using GDP deflator and GDP PPP source OECD
> 
> 
> 3. OECD STAN database
> 
> Trade openness. We measure the degree of openness to trade
>         by the ratio of industry import over value added in each specific
>         industry. The data is collected from the OECD STAN database, which contains
>         data on total exports and imports for 19 OECD countries, plus the
>         EU, from 1987 to 2004, disaggregated by industry.
> 
> 4. OECD PMR database
> 
> Product Market Regulation. We measure the tightness of
>         product market regulation by the aggregate PMR index, taken from the
>         OECD PMR database. The aggregate PMR index covers formal regulations
>         in the following areas: state control of business enterprizes, legal
>         and administrative barriers to entrepreneurship, and barriers to
>         international trade and investment. The tightness of regulation is
>         measured at the national level on a scale between 0 and 6, where
>         lower values indicate less tight regulation. Data on PMR are
>         available for two years: 1998 and 2003.
>         
>         The original data exist only for 1998 and 2003. We made the following 
>         imputation:
>         - for the years before 1998, we use the 1998 data
>         - for the yaers between 1998 and 2003, we use the average between the 1998 and 2003 vales
>         - for the years after 2003, we use the 2003 data        
>         
> 5. World Bank Worldwide Governance Indicators (WGI) database
> 
>         This database collects aggregate and individual
>         indicators for six dimensions of governance: voice and
>         accountability, political stability and absence of violence,
>         government effectiveness, regulatory quality, rule of law, control
>         of corruption. The data cover 212 countries and territories over the period 1996-2006
>         and are based on the views of a large number of enterprisers,
>         citizens, and experts. We use the index that measures the national
>         rule of law, as the most appropriate indicator of a country's legal
>         system. The index takes values from -2.5 to 2.5, with higher values
>         indicating better governance outcomes.
>  
> 6. Fraser Institute Database
> 
>         This Database, which is used to construct the 'Economic Freedom of the World' indexes. From
>         this database, we use an aggregate index (index\_2) called 'legal
>         system', which aggregates information on variables measuring
>         judiciary independence, impartiality of the courts, protection of
>         intellectual property, law and order, and legal enforcement of
>         contracts. These indexes, just like the WGIs, are based on the perceptions
>         of enterprisers, citizens and experts. The indexes take values
>         between 0 and 10, with higher values indicating better governance
>         outcomes.
> 
> 7. The Doing Business database of the World Bank
> 
>         This database collects data representing 'objective measures' of the overall quality of the
>         regulatory and institutional environment in 181 countries. The data
>         we use in our empirical model relate to the time and cost of
>         enforcing debt contracts through the national courts
>         system. The time of enforcing debt contracts represents the
>         estimated duration, in calendar days, between the moment of issuance
>         of judgment and the moment the landlord repossesses the property
>         (for the eviction case) or the creditor obtains payment (for the
>         check collection case). The cost of enforcing contracts represents
>         the estimated cost as a percentage of the debt involved in the
>         contract. For a full description, see Djankov et. al
>         (2003b). Both variables have been measured within
>         the Doing Business Project from 2004 on. In our specifications, we
>         use the end of sample (2005) values, and assume it represents the
>         quality of contracts enforced for the entire sample period.
> 
> 8. The legal origin database from La Porta et al. (1997).
> 
> 9. An enhanced version of the Political Manifesto Database
> 
>         The political variables taht we use are derived from the dataset developed by Cusack and
>         Fuchs (2002) which uses two main sources: the first is
>         a database on political parties' programmatic position developed in
>         the Manifesto dataset by Klingemann et al. (2006),
>         while the second is the database developed by Woldendorp, Keman, and
>         Budge (2000) on government compositions for 48
>         countries from 1948 onwards. For each country and year in our
>         sample, we create measures of a government location along the
>         Manifesto�s political dimensions by taking a weighted average of the
>         programmatic positions of each of the parties belonging to
>         government coalition. As weights, we used the number of each party's
>         votes. We used the following programmatic positions:
> 
> Market regulation (per403). This variable measures
>         favorable mentions in the parties' programs of the need for
>         regulations to make private enterprizes work better, actions against
>         monopoly and trusts, in defence of consumer, and encouraging
>         economic competition.
> 
> Economic planning (per404). This variable measures
>         favorable mentions in the parties' programs of long-standing
>         economic planning of a consultative or indicative nature.
> 
> Welfare state limitations planning (per505). This variable
>         measures negative mentions in the parties' programs of the need to
>         introduce, maintain or expand any social service or social security scheme.
> 
> European Community (per108): This variable measures
>         favorable mentions in the parties' programs of the European
>         Community in general, and on the desirability of expanding its competency.
> 
> **************************************************************************************/
. 
. 
. *generate country-industry dummies
. egen identif=group(iso_code isicrev3)
(11 missing values generated)

. tab identif, gen (dummy2_)

group(iso_c |
        ode |
  isicrev3) |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |         11        0.38        0.38
          2 |         11        0.38        0.76
          3 |         11        0.38        1.14
          4 |         11        0.38        1.52
          5 |         11        0.38        1.89
          6 |         11        0.38        2.27
          7 |         11        0.38        2.65
          8 |         11        0.38        3.03
          9 |         11        0.38        3.41
         10 |         11        0.38        3.79
         11 |         11        0.38        4.17
         12 |         11        0.38        4.55
         13 |         11        0.38        4.92
         14 |         11        0.38        5.30
         15 |         11        0.38        5.68
         16 |         11        0.38        6.06
         17 |         11        0.38        6.44
         18 |         11        0.38        6.82
         19 |         11        0.38        7.20
         20 |         11        0.38        7.58
         21 |         11        0.38        7.95
         22 |         11        0.38        8.33
         23 |         11        0.38        8.71
         24 |         11        0.38        9.09
         25 |         11        0.38        9.47
         26 |         11        0.38        9.85
         27 |         11        0.38       10.23
         28 |         11        0.38       10.61
         29 |         11        0.38       10.98
         30 |         11        0.38       11.36
         31 |         11        0.38       11.74
         32 |         11        0.38       12.12
         33 |         11        0.38       12.50
         34 |         11        0.38       12.88
         35 |         11        0.38       13.26
         36 |         11        0.38       13.64
         37 |         11        0.38       14.02
         38 |         11        0.38       14.39
         39 |         11        0.38       14.77
         40 |         11        0.38       15.15
         41 |         11        0.38       15.53
         42 |         11        0.38       15.91
         43 |         11        0.38       16.29
         44 |         11        0.38       16.67
         45 |         11        0.38       17.05
         46 |         11        0.38       17.42
         47 |         11        0.38       17.80
         48 |         11        0.38       18.18
         49 |         11        0.38       18.56
         50 |         11        0.38       18.94
         51 |         11        0.38       19.32
         52 |         11        0.38       19.70
         53 |         11        0.38       20.08
         54 |         11        0.38       20.45
         55 |         11        0.38       20.83
         56 |         11        0.38       21.21
         57 |         11        0.38       21.59
         58 |         11        0.38       21.97
         59 |         11        0.38       22.35
         60 |         11        0.38       22.73
         61 |         11        0.38       23.11
         62 |         11        0.38       23.48
         63 |         11        0.38       23.86
         64 |         11        0.38       24.24
         65 |         11        0.38       24.62
         66 |         11        0.38       25.00
         67 |         11        0.38       25.38
         68 |         11        0.38       25.76
         69 |         11        0.38       26.14
         70 |         11        0.38       26.52
         71 |         11        0.38       26.89
         72 |         11        0.38       27.27
         73 |         11        0.38       27.65
         74 |         11        0.38       28.03
         75 |         11        0.38       28.41
         76 |         11        0.38       28.79
         77 |         11        0.38       29.17
         78 |         11        0.38       29.55
         79 |         11        0.38       29.92
         80 |         11        0.38       30.30
         81 |         11        0.38       30.68
         82 |         11        0.38       31.06
         83 |         11        0.38       31.44
         84 |         11        0.38       31.82
         85 |         11        0.38       32.20
         86 |         11        0.38       32.58
         87 |         11        0.38       32.95
         88 |         11        0.38       33.33
         89 |         11        0.38       33.71
         90 |         11        0.38       34.09
         91 |         11        0.38       34.47
         92 |         11        0.38       34.85
         93 |         11        0.38       35.23
         94 |         11        0.38       35.61
         95 |         11        0.38       35.98
         96 |         11        0.38       36.36
         97 |         11        0.38       36.74
         98 |         11        0.38       37.12
         99 |         11        0.38       37.50
        100 |         11        0.38       37.88
        101 |         11        0.38       38.26
        102 |         11        0.38       38.64
        103 |         11        0.38       39.02
        104 |         11        0.38       39.39
        105 |         11        0.38       39.77
        106 |         11        0.38       40.15
        107 |         11        0.38       40.53
        108 |         11        0.38       40.91
        109 |         11        0.38       41.29
        110 |         11        0.38       41.67
        111 |         11        0.38       42.05
        112 |         11        0.38       42.42
        113 |         11        0.38       42.80
        114 |         11        0.38       43.18
        115 |         11        0.38       43.56
        116 |         11        0.38       43.94
        117 |         11        0.38       44.32
        118 |         11        0.38       44.70
        119 |         11        0.38       45.08
        120 |         11        0.38       45.45
        121 |         11        0.38       45.83
        122 |         11        0.38       46.21
        123 |         11        0.38       46.59
        124 |         11        0.38       46.97
        125 |         11        0.38       47.35
        126 |         11        0.38       47.73
        127 |         11        0.38       48.11
        128 |         11        0.38       48.48
        129 |         11        0.38       48.86
        130 |         11        0.38       49.24
        131 |         11        0.38       49.62
        132 |         11        0.38       50.00
        133 |         11        0.38       50.38
        134 |         11        0.38       50.76
        135 |         11        0.38       51.14
        136 |         11        0.38       51.52
        137 |         11        0.38       51.89
        138 |         11        0.38       52.27
        139 |         11        0.38       52.65
        140 |         11        0.38       53.03
        141 |         11        0.38       53.41
        142 |         11        0.38       53.79
        143 |         11        0.38       54.17
        144 |         11        0.38       54.55
        145 |         11        0.38       54.92
        146 |         11        0.38       55.30
        147 |         11        0.38       55.68
        148 |         11        0.38       56.06
        149 |         11        0.38       56.44
        150 |         11        0.38       56.82
        151 |         11        0.38       57.20
        152 |         11        0.38       57.58
        153 |         11        0.38       57.95
        154 |         11        0.38       58.33
        155 |         11        0.38       58.71
        156 |         11        0.38       59.09
        157 |         11        0.38       59.47
        158 |         11        0.38       59.85
        159 |         11        0.38       60.23
        160 |         11        0.38       60.61
        161 |         11        0.38       60.98
        162 |         11        0.38       61.36
        163 |         11        0.38       61.74
        164 |         11        0.38       62.12
        165 |         11        0.38       62.50
        166 |         11        0.38       62.88
        167 |         11        0.38       63.26
        168 |         11        0.38       63.64
        169 |         11        0.38       64.02
        170 |         11        0.38       64.39
        171 |         11        0.38       64.77
        172 |         11        0.38       65.15
        173 |         11        0.38       65.53
        174 |         11        0.38       65.91
        175 |         11        0.38       66.29
        176 |         11        0.38       66.67
        177 |         11        0.38       67.05
        178 |         11        0.38       67.42
        179 |         11        0.38       67.80
        180 |         11        0.38       68.18
        181 |         11        0.38       68.56
        182 |         11        0.38       68.94
        183 |         11        0.38       69.32
        184 |         11        0.38       69.70
        185 |         11        0.38       70.08
        186 |         11        0.38       70.45
        187 |         11        0.38       70.83
        188 |         11        0.38       71.21
        189 |         11        0.38       71.59
        190 |         11        0.38       71.97
        191 |         11        0.38       72.35
        192 |         11        0.38       72.73
        193 |         11        0.38       73.11
        194 |         11        0.38       73.48
        195 |         11        0.38       73.86
        196 |         11        0.38       74.24
        197 |         11        0.38       74.62
        198 |         11        0.38       75.00
        199 |         11        0.38       75.38
        200 |         11        0.38       75.76
        201 |         11        0.38       76.14
        202 |         11        0.38       76.52
        203 |         11        0.38       76.89
        204 |         11        0.38       77.27
        205 |         11        0.38       77.65
        206 |         11        0.38       78.03
        207 |         11        0.38       78.41
        208 |         11        0.38       78.79
        209 |         11        0.38       79.17
        210 |         11        0.38       79.55
        211 |         11        0.38       79.92
        212 |         11        0.38       80.30
        213 |         11        0.38       80.68
        214 |         11        0.38       81.06
        215 |         11        0.38       81.44
        216 |         11        0.38       81.82
        217 |         11        0.38       82.20
        218 |         11        0.38       82.58
        219 |         11        0.38       82.95
        220 |         11        0.38       83.33
        221 |         11        0.38       83.71
        222 |         11        0.38       84.09
        223 |         11        0.38       84.47
        224 |         11        0.38       84.85
        225 |         11        0.38       85.23
        226 |         11        0.38       85.61
        227 |         11        0.38       85.98
        228 |         11        0.38       86.36
        229 |         11        0.38       86.74
        230 |         11        0.38       87.12
        231 |         11        0.38       87.50
        232 |         11        0.38       87.88
        233 |         11        0.38       88.26
        234 |         11        0.38       88.64
        235 |         11        0.38       89.02
        236 |         11        0.38       89.39
        237 |         11        0.38       89.77
        238 |         11        0.38       90.15
        239 |         11        0.38       90.53
        240 |         11        0.38       90.91
        241 |         11        0.38       91.29
        242 |         11        0.38       91.67
        243 |         11        0.38       92.05
        244 |         11        0.38       92.42
        245 |         11        0.38       92.80
        246 |         11        0.38       93.18
        247 |         11        0.38       93.56
        248 |         11        0.38       93.94
        249 |         11        0.38       94.32
        250 |         11        0.38       94.70
        251 |         11        0.38       95.08
        252 |         11        0.38       95.45
        253 |         11        0.38       95.83
        254 |         11        0.38       96.21
        255 |         11        0.38       96.59
        256 |         11        0.38       96.97
        257 |         11        0.38       97.35
        258 |         11        0.38       97.73
        259 |         11        0.38       98.11
        260 |         11        0.38       98.48
        261 |         11        0.38       98.86
        262 |         11        0.38       99.24
        263 |         11        0.38       99.62
        264 |         11        0.38      100.00
------------+-----------------------------------
      Total |      2,904      100.00

. label var identif "Identifier: industry-country"

. 
. * generate year dummies
. tab year, gen (y_)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1995 |        265        9.09        9.09
       1996 |        265        9.09       18.18
       1997 |        265        9.09       27.27
       1998 |        265        9.09       36.36
       1999 |        265        9.09       45.45
       2000 |        265        9.09       54.55
       2001 |        265        9.09       63.64
       2002 |        265        9.09       72.73
       2003 |        265        9.09       81.82
       2004 |        265        9.09       90.91
       2005 |        265        9.09      100.00
------------+-----------------------------------
      Total |      2,915      100.00

. 
. * generate industry dummies
. tab isicrev3, gen (ind_)

 Industrial |
classificat |
   ion Isic |
 Revision 3 |      Freq.     Percent        Cum.
------------+-----------------------------------
      01-05 |        132        4.55        4.55
      10-14 |        132        4.55        9.09
      15-16 |        132        4.55       13.64
      17-19 |        132        4.55       18.18
         20 |        132        4.55       22.73
      21-22 |        132        4.55       27.27
         23 |        132        4.55       31.82
         24 |        132        4.55       36.36
         25 |        132        4.55       40.91
         26 |        132        4.55       45.45
      27-28 |        132        4.55       50.00
         29 |        132        4.55       54.55
      30-33 |        132        4.55       59.09
      34-35 |        132        4.55       63.64
      36-37 |        132        4.55       68.18
      40-41 |        132        4.55       72.73
         45 |        132        4.55       77.27
         55 |        132        4.55       81.82
      60-63 |        132        4.55       86.36
         64 |        132        4.55       90.91
      65-67 |        132        4.55       95.45
      71-74 |        132        4.55      100.00
------------+-----------------------------------
      Total |      2,904      100.00

. 
. * generate country dummies
. tab iso_code, gen (cn_)

    country |      Freq.     Percent        Cum.
------------+-----------------------------------
        Can |        242        8.30        8.30
        Cze |        242        8.30       16.60
         EU |         11        0.38       16.98
        Fra |        242        8.30       25.28
        Ger |        242        8.30       33.58
        Hun |        242        8.30       41.89
        Ita |        242        8.30       50.19
        Jap |        242        8.30       58.49
        Net |        242        8.30       66.79
        Spa |        242        8.30       75.09
        Swe |        242        8.30       83.40
         UK |        242        8.30       91.70
        USA |        242        8.30      100.00
------------+-----------------------------------
      Total |      2,915      100.00

. 
. 
. * value added variables
. gen valurealklems=valureal
(253 missing values generated)

. gen valur=valuk/100*valu95 if iso_code=="Can"
(2717 missing values generated)

. 
. replace valurealklems=valur if iso_code=="Can"
(198 real changes made)

. label var valurealklems "Value Added Real"

. 
. gen valurealklemsppp=valurealklems/gdp_ppp
(55 missing values generated)

. label var valurealklemsppp "Value Added Real, constant ppp"

. 
. gen va1=va
(253 missing values generated)

. replace va1=valu_nominal if iso_code=="Can" 
(154 real changes made)

. label var va1 "Value added nominal"

. 
. * generate industry trends
. gen year2=year^2

. gen yhat=.
(2915 missing values generated)

. forvalues n=1/264{
  2. quietly reg valurealklemsppp year year2 if identif==`n'
  3. quietly predict a
  4. quietly replace yhat=a if identif==`n'
  5. drop a
  6. }

. 
. gen ind_trend=(valurealklems - yhat)/10000000
(55 missing values generated)

. label var ind_trend "Industry trend"

. 
. *labour share
. gen lab1=lab
(253 missing values generated)

. label var lab1 "Labour compensation"

. 
. gen lab1can=labourshare*valu_nominal
(2761 missing values generated)

. replace lab1=lab1can if iso_code=="Can"
(154 real changes made)

. label var lab1can "Labour compensation Canada"

. 
. *markups
. gen pcmpoolklems=va1/(lab1 + (govbond-inflat+0.07)*icaprklems)
(407 missing values generated)

. label var pcmpoolklems "Price Cost Margin"

. 
.                 **********************************************************************************************************
> ********
.                 **********************************************************************************************************
> ********
.                 ** NOTE:                                                                                                  
>                                                                                                               **
.                 ** Icaprklems has been created according to the following formula (an exact reconstruction within this do 
> file  **
.                 ** is not possible given the update in the Klems database and the fact that we use of data from 1990. The 
> com-  **
.                 ** mands to generate this variable are the following:                                                     
>                                                               **
.                 **                                                                                                        
>                                                                                                                       **
.                 ** gen gfcfrklems=iq_gfcf                                                                                 
>                                                                                               **
.                 ** replace gfcfrklems=gfcfr if iq_gfcf==.                                                                 
>                                                                               **
.                 ** so country isic year                                                                                   
>                                                                                               **
.                 ** gen rrklems=1 if gfcfrklems>0.1&gfcfrklems<100000000                                                   
>                                                               **
.                 ** egen rryearklems = min(rrklems*year), by(country isic)                                                 
>                                                               **
.                 ** so country isic                                                                                        
>                                                                                                       **
.                 ** gen icaprklems = gfcfrklems/(kdepr+0.03) if year==rryearklems                                          
>                                                       **
.                 ** qui by country isic: replace icaprklems = icaprklems[_n-1]*(1-kdepr) + gfcfrklems if year>rryearklems  
>               **
.                 **                                                                                                        
>                                                                                                                       **
.                 ** where                                                                                                  
>                                                                                                               **
.                 ** iq_gfcf = Real gross fixed capital formation, bse year 2000 (Source Klems)                             
>                                       **
.                 ** gfcfr= Real gross fixed capital formation (PPP) for non Klems countries, using STAN (variable GFCF - gr
> oss   **
.                 ** fixed capital formation at current prices / GDP deflator base year 2000 (Source OECD - MEI)            
>                       **
.                 **                                                                                                        
>                                                                                                                       **
.                 **********************************************************************************************************
> ********
.                 **********************************************************************************************************
> ********
. 
. 
. *TFP growth corrrected for markups
. xtset identif year
       panel variable:  identif (weakly balanced)
        time variable:  year, 1995 to 2005
                delta:  1 unit

. gen tfpcorrectedklems= (va_qi-l.va_qi)/l.va_qi - (pcmpoolklems*cap/(cap+lab)+l.pcmpoolklems*l.cap/(l.cap+l.lab))/2*((cap_q
> i- l.cap_qi)/l.cap_qi)-(pcmpoolklems*lab/(lab+cap)+l.pcmpoolklems*l.lab/(l.lab+l.cap))/2*((lab_qi-l.lab_qi)/l.lab_qi)
(796 missing values generated)

. gen tfpcorrectedklemscan=output- (pcmpoolklems*labourshare+l.pcmpoolklems*l.labourshare)/2*labour- (pcmpoolklems*ictshare+
> l.pcmpoolklems*l.ictshare)/2*ictcapital-(pcmpoolklems*(1-labourshare-ictshare)+ l.pcmpoolklems*(1-l.labourshare-l.ictshare
> ))/2* nonictcapital 
(2783 missing values generated)

. gen tfpcorrectedoverklems=tfpcorrectedklems
(796 missing values generated)

. replace tfpcorrectedoverklems=tfpcorrectedklemscan/100 if iso_code=="Can"
(132 real changes made)

. label var tfpcorrectedoverklems "TFP growth"

. 
.  
. * Tecnology Gap & TFP growth of the leader
. bysort isic year: egen avervalurklems =gmean(valurealklemsppp)
(11 missing values generated)

. 
. gen labourshareklems=lab/va if iso_code!="Can"
(253 missing values generated)

. replace labourshareklems=labourshare if iso_code=="Can"
(198 real changes made)

. 
. gen capitalshareklems=cap/va if iso_code!="Can"
(253 missing values generated)

. replace capitalshareklems=(1-labourshare) if iso_code=="Can"
(198 real changes made)

. 
. gen labourshareklemscorr=labourshareklems*pcmpoolklems 
(407 missing values generated)

. bysort isic year: egen averlabourshareklemscorr=gmean(labourshareklemscorr)
(11 missing values generated)

. 
. gen capitalshareklemscorr=capitalshareklems*pcmpoolklems
(407 missing values generated)

. bysort isic year: egen avercapitalshareklemscorr=gmean(capitalshareklemscorr)
(11 missing values generated)

. 
. gen capstockklemsppp =icaprklems/gdp_ppp
(363 missing values generated)

. bysort isic year: egen avercapstockklemsppp =gmean(capstockklemsppp)
(11 missing values generated)

. 
. gen labourgrif=((H_EMP*HHS)^labhs)*((H_EMP*HMS)^labms)*((H_EMP*HLS)^labls)
(253 missing values generated)

. replace labourgrif=H_empcan if iso_code=="Can"
(196 real changes made)

. bysort isic year: egen averlabour=gmean(labourgrif)
(11 missing values generated)

. 
. gen tecratioklems =ln(valurealklemsppp /avervalurklems )-(capitalshareklemscorr+avercapitalshareklemscorr)/2*ln(capstockkl
> emsppp /avercapstockklemsppp ) -(labourshareklemscorr+averlabourshareklemscorr)/2*ln(labourgrif/averlabour)
(409 missing values generated)

. bysort year isic: egen tecnoleaderklems =max(tecratioklems)
(11 missing values generated)

. 
. gen tecnogapklems =tecnoleaderklems -tecratioklems 
(409 missing values generated)

. label var tecnogapklems "Techno Gap"

. 
. gen zz=tfpcorrectedoverklems if tecnogapklems ==0
(2696 missing values generated)

. bysort isic year: egen tfpleadershipklems =mean(zz)
(287 missing values generated)

. drop zz

. label var tfpleadershipklems "TFP leader"

. 
. 
. * Labourproductivity / labour productivity gap 
. gen labourproductivityklems =valurealklemsppp /labourgrif
(57 missing values generated)

. xtset identif year
       panel variable:  identif (weakly balanced)
        time variable:  year, 1995 to 2005
                delta:  1 unit

. by identif: gen LPgrowth= (labourproductivityklems - l.labourproductivityklems)/ l.labourproductivityklems
(321 missing values generated)

. label var LPgrowth "LP Growth"

. 
. bysort year isic: egen leaderproductivityklems =max(labourproductivityklems)
(11 missing values generated)

. bysort year isic: gen productivitygapklems =leaderproductivityklems /labourproductivityklems 
(57 missing values generated)

. 
. gen zz=labourproductivityklems if productivitygapklems ==1
(2673 missing values generated)

. bysort isic year: egen labourproductivityleaderklems=mean(zz)
(11 missing values generated)

. replace labourproductivityleaderklems=labourproductivityleaderklems/10000
(2904 real changes made)

. label var labourproductivityleaderklems "LP leader"

. 
. drop zz

. gen tecnogapklemsLP=productivitygapklems 
(57 missing values generated)

. label var tecnogapklemsLP "Techno Gap - LP"

. 
. *tradelib
. 
.                 **********************************************************************************************************
> ********
.                 **********************************************************************************************************
> ********
.                 ** NOTE:                                                                                                  
>                                                                                                               **
.                 **                                                                                                        
>                                                                                                                       **
.                 ** For tadelib we made two imputations                                                                    
>                                                                               **
.                 ** 1. impute the 2003 value of trade liberalization in 2004 to increase sample size                       
>                                       **
.                 ** 2. set imports = 0 for the sectors 17-22                                                               
>                                                                       **
.                 **********************************************************************************************************
> ********
.                 **********************************************************************************************************
> ********
. 
. gen tradelib= (impo)/ valurealklemsppp
(406 missing values generated)

. label var tradelib "Import penetration"

. xtset identif year
       panel variable:  identif (weakly balanced)
        time variable:  year, 1995 to 2005
                delta:  1 unit

. gen xx=l.tradelib
(472 missing values generated)

. replace tradelib = xx if year==2004
(197 real changes made)

. drop xx

.  
. replace compindex=. if enf==.
(0 real changes made)

. replace antitrust=. if enf==.
(0 real changes made)

. 
. *The CPI EU variable is constructed as follow
. *gen CPI_EU=(2/3)*instoveral+(1/3)*enf
. *replace resourcesindex=. if resourcesindex==-3
. 
. so identif year

. 
. save BCDVS_95_4_2013_estimation_data.dta, replace
file BCDVS_95_4_2013_estimation_data.dta saved

. 
. log close
      name:  <unnamed>
       log:  D:\users\TD\TD work\PAPERS\TFP comp policy\econometrics\REStatcodes\BCDVS_95_4_2013_datageneration.log
  log type:  text
 closed on:  28 Mar 2014, 18:21:51
----------------------------------------------------------------------------------------------------------------------------
